package nl.weeaboo.sh.danmaku.commands;

import nl.weeaboo.sh.danmaku.ShotModel;
import nl.weeaboo.sh.danmaku.Spell;
import nl.weeaboo.sh.danmaku.SpellBook;
import nl.weeaboo.sh.danmaku.Universe;

public class TSplit extends Spell {
	
	private int copies;
	
	public TSplit(int copies) {
		this.copies = copies;
	}
	protected TSplit(TSplit t) {
		super(t);
		copies = t.copies;
	}
	
	public TSplit clone() {
		return new TSplit(this);
	}
	
	@Override
	public void step(Universe u, SpellBook sb, ShotModel s) {
		for (int n = 0; n < copies; n++) {
			u.addShot(s.clone());
		}
		u.removeShot(s);
		finish();
	}	

}
